﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FoneBuddy.LinqModel.Data;
using FoneBuddy.LinqModel;


namespace FoneBuddy.LinqModel
{
   public partial class Product
    {
         #region Variable Declaration
        private IDataRepository _dataObject;
        #endregion

        public Product(IDataRepository dataObject)
            : this()
        {
            _dataObject = dataObject;
        }
        public List<Brand> GetAllBrands()
        {
            return _dataObject.GetAllBrand();
        }
        public void Create()
        {
            _dataObject.CreateProduct(this);
        }
        public string GenerateProductCode()
        {
            return _dataObject.GenerateProductCode();
        }
        public List<Product> GetAll()
        {
            return _dataObject.GetAllProduct();
        }
        public void getProductByName()
        {
             _dataObject.GetProductByName(this);
        }
        public void Update()
        {
            _dataObject.UpdateProduct(this);
        }
        public void getProductById()
        {
            _dataObject.GetProductById(this);
        }
        public void Delete()
        {
            _dataObject.DeleteProduct(this);
        }
    }
}
